/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package descent;


import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

/**
 *
 * @author Luke
 */
public class Ability {
    String description;
    
    public Ability(int abilityId){
        try {
            Class.forName("com.mysql.jdbc.Driver");
        
            Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/Descent", "root", "root");
            Statement statement = connection.createStatement();
            ResultSet resultSet = statement.executeQuery("SELECT description FROM abilities where id = " + abilityId);
            while (resultSet.next()) {
                description = resultSet.getString("description");
                System.out.println("Ability:" + description);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
   
    public String getDescription(){
        return description;      
    }
    
    public static void main(String args[]){
        Ability ability0 = new Ability(1);
        Ability ability1 = new Ability(4);
        Ability ability2 = new Ability(2);
        Ability ability3 = new Ability(3);
        
    }
}
